List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:October 14 2009 11:15am
Subject:bzr push into mysql-5.5.0-next-mr-runtime branch (kostja:2917 to 2918)
View as plain text  
 2918 Konstantin Osipov	2009-10-14
      Backport of:
      ----------------------------------------------------------
      revno: 2630.22.8
      committer: Konstantin Osipov <konstantin@stripped>
      branch nick: mysql-6.0-runtime
      timestamp: Sun 2008-08-10 18:49:52 +0400
      message:
        Get rid of typedef struct for the most commonly used types:
        TABLE, TABLE_SHARE, LEX. This simplifies use of tags
        and forward declarations.

    modified:
      sql/field.cc
      sql/field.h
      sql/handler.h
      sql/mysql_priv.h
      sql/rpl_injector.h
      sql/rpl_tblmap.h
      sql/sql_base.cc
      sql/sql_cache.h
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_show.cc
      sql/sql_yacc.yy
      sql/structs.h
      sql/table.cc
      sql/table.h
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/handler0alter.h
      storage/innobase/include/row0merge.h
      storage/innobase/include/row0types.h
      storage/innobase/row/row0merge.c
 2917 Konstantin Osipov	2009-10-14
      ----------------------------------------------------------
      revno: 2630.2.16
      committer: Konstantin Osipov <konstantin@stripped>
      branch nick: mysql-6.0-runtime
      timestamp: Fri 2008-06-27 13:26:03 +0400
      message:
        Fix max_user_connections_func failure on Solaris.
        A connection that failed to log in due to a resource limit could
        be returned to the thread pool with a dangling link to user_connect
        structure of an old user. Later on it could be authenticated
        to a user that doesn't have a resource limit, so this dangling
        link won't be reset. --pool-of-threads mode made the situation
        easy to reproduce, and thus highlighted a bug that has been
        around forever.
        Make sure there are no dangling links.
     @ sql/sql_connect.cc
        Do not return a connection structure to the thread pool with a dangling link.

    modified:
      sql/sql_connect.cc
=== modified file 'sql/field.cc'
--- a/sql/field.cc	2009-10-09 13:34:07 +0000
+++ b/sql/field.cc	2009-10-14 11:14:58 +0000
@@ -1799,7 +1799,7 @@ bool Field::optimize_range(uint idx, uin
 }
 
 
-Field *Field::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field::new_field(MEM_ROOT *root, TABLE *new_table,
                         bool keep_type __attribute__((unused)))
 {
   Field *tmp;
@@ -1820,7 +1820,7 @@ Field *Field::new_field(MEM_ROOT *root, 
 }
 
 
-Field *Field::new_key_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field::new_key_field(MEM_ROOT *root, TABLE *new_table,
                             uchar *new_ptr, uchar *new_null_ptr,
                             uint new_null_bit)
 {
@@ -1837,7 +1837,7 @@ Field *Field::new_key_field(MEM_ROOT *ro
 
 /* This is used to generate a field in TABLE from TABLE_SHARE */
 
-Field *Field::clone(MEM_ROOT *root, struct st_table *new_table)
+Field *Field::clone(MEM_ROOT *root, TABLE *new_table)
 {
   Field *tmp;
   if ((tmp= (Field*) memdup_root(root,(char*) this,size_of())))
@@ -7003,7 +7003,7 @@ uint Field_string::get_key_image(uchar *
 }
 
 
-Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field_string::new_field(MEM_ROOT *root, TABLE *new_table,
                                bool keep_type)
 {
   Field *field;
@@ -7581,7 +7581,7 @@ int Field_varstring::cmp_binary(const uc
 }
 
 
-Field *Field_varstring::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field_varstring::new_field(MEM_ROOT *root, TABLE *new_table,
                                   bool keep_type)
 {
   Field_varstring *res= (Field_varstring*) Field::new_field(root, new_table,
@@ -7593,7 +7593,7 @@ Field *Field_varstring::new_field(MEM_RO
 
 
 Field *Field_varstring::new_key_field(MEM_ROOT *root,
-                                      struct st_table *new_table,
+                                      TABLE *new_table,
                                       uchar *new_ptr, uchar *new_null_ptr,
                                       uint new_null_bit)
 {
@@ -8723,7 +8723,7 @@ void Field_enum::sql_type(String &res) c
 }
 
 
-Field *Field_enum::new_field(MEM_ROOT *root, struct st_table *new_table,
+Field *Field_enum::new_field(MEM_ROOT *root, TABLE *new_table,
                              bool keep_type)
 {
   Field_enum *res= (Field_enum*) Field::new_field(root, new_table, keep_type);
@@ -9021,7 +9021,7 @@ Field_bit::do_last_null_byte() const
 
 
 Field *Field_bit::new_key_field(MEM_ROOT *root,
-                                struct st_table *new_table,
+                                TABLE *new_table,
                                 uchar *new_ptr, uchar *new_null_ptr,
                                 uint new_null_bit)
 {

=== modified file 'sql/field.h'
--- a/sql/field.h	2009-09-28 07:21:25 +0000
+++ b/sql/field.h	2009-10-14 11:14:58 +0000
@@ -60,8 +60,8 @@ public:
     Note that you can use table->in_use as replacement for current_thd member 
     only inside of val_*() and store() members (e.g. you can't use it in cons)
   */
-  struct st_table *table;		// Pointer for table
-  struct st_table *orig_table;		// Pointer to original table
+  TABLE *table;                                 // Pointer for table
+  TABLE *orig_table;                            // Pointer to original table
   const char	**table_name, *field_name;
   LEX_STRING	comment;
   /* Field is part of the following keys */
@@ -301,12 +301,12 @@ public:
   */
   virtual bool can_be_compared_as_longlong() const { return FALSE; }
   virtual void free() {}
-  virtual Field *new_field(MEM_ROOT *root, struct st_table *new_table,
+  virtual Field *new_field(MEM_ROOT *root, TABLE *new_table,
                            bool keep_type);
-  virtual Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
+  virtual Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                                uchar *new_ptr, uchar *new_null_ptr,
                                uint new_null_bit);
-  Field *clone(MEM_ROOT *mem_root, struct st_table *new_table);
+  Field *clone(MEM_ROOT *mem_root, TABLE *new_table);
   inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg)
   {
     ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
@@ -1506,7 +1506,7 @@ public:
   enum_field_types real_type() const { return MYSQL_TYPE_STRING; }
   bool has_charset(void) const
   { return charset() == &my_charset_bin ? FALSE : TRUE; }
-  Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
+  Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
   virtual uint get_key_image(uchar *buff,uint length, imagetype type);
 private:
   int do_save_field_metadata(uchar *first_byte);
@@ -1593,8 +1593,8 @@ public:
   enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; }
   bool has_charset(void) const
   { return charset() == &my_charset_bin ? FALSE : TRUE; }
-  Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
-  Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
+  Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
+  Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                        uchar *new_ptr, uchar *new_null_ptr,
                        uint new_null_bit);
   uint is_equal(Create_field *new_field);
@@ -1833,7 +1833,7 @@ public:
   {
       flags|=ENUM_FLAG;
   }
-  Field *new_field(MEM_ROOT *root, struct st_table *new_table, bool keep_type);
+  Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
   enum_field_types type() const { return MYSQL_TYPE_STRING; }
   enum Item_result cmp_type () const { return INT_RESULT; }
   enum Item_result cast_to_int_type () const { return INT_RESULT; }
@@ -1971,7 +1971,7 @@ public:
                               uint param_data, bool low_byte_first);
   virtual void set_default();
 
-  Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
+  Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
                        uchar *new_ptr, uchar *new_null_ptr,
                        uint new_null_bit);
   void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2009-08-17 14:14:51 +0000
+++ b/sql/handler.h	2009-10-14 11:14:58 +0000
@@ -505,9 +505,8 @@ class st_alter_tablespace : public Sql_a
 
 /* The handler for a table type.  Will be included in the TABLE structure */
 
-struct st_table;
-typedef struct st_table TABLE;
-typedef struct st_table_share TABLE_SHARE;
+struct TABLE;
+struct TABLE_SHARE;
 struct st_foreign_key_info;
 typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
 typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len,
@@ -1076,8 +1075,8 @@ class handler :public Sql_alloc
 public:
   typedef ulonglong Table_flags;
 protected:
-  struct st_table_share *table_share;   /* The table definition */
-  struct st_table *table;               /* The current open table */
+  TABLE_SHARE *table_share;   /* The table definition */
+  TABLE *table;               /* The current open table */
   Table_flags cached_table_flags;       /* Set on init() and open() */
 
   ha_rows estimation_rows_to_insert;

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2009-10-13 18:18:48 +0000
+++ b/sql/mysql_priv.h	2009-10-14 11:14:58 +0000
@@ -641,7 +641,6 @@ enum enum_parsing_place
   IN_ON
 };
 
-struct st_table;
 
 #define thd_proc_info(thd, msg)  set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
 class THD;

=== modified file 'sql/rpl_injector.h'
--- a/sql/rpl_injector.h	2007-05-10 09:59:39 +0000
+++ b/sql/rpl_injector.h	2009-10-14 11:14:58 +0000
@@ -25,9 +25,8 @@
 /* Forward declarations */
 class handler;
 class MYSQL_BIN_LOG;
-struct st_table;
+struct TABLE;
 
-typedef st_table TABLE;
 
 /*
   Injector to inject rows into the MySQL server.

=== modified file 'sql/rpl_tblmap.h'
--- a/sql/rpl_tblmap.h	2008-08-20 14:06:31 +0000
+++ b/sql/rpl_tblmap.h	2009-10-14 11:14:58 +0000
@@ -18,8 +18,7 @@
 
 /* Forward declarations */
 #ifndef MYSQL_CLIENT
-struct st_table;
-typedef st_table TABLE;
+struct TABLE;
 #else
 class Table_map_log_event;
 typedef Table_map_log_event TABLE;

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2009-09-17 09:20:11 +0000
+++ b/sql/sql_base.cc	2009-10-14 11:14:58 +0000
@@ -2927,7 +2927,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *
         Set 1 as a flag here
       */
       if (error < 0)
-        table_list->view= (st_lex*)1;
+        table_list->view= (LEX*)1;
 
       my_free((uchar*)table, MYF(0));
       VOID(pthread_mutex_unlock(&LOCK_open));

=== modified file 'sql/sql_cache.h'
--- a/sql/sql_cache.h	2009-10-13 18:18:48 +0000
+++ b/sql/sql_cache.h	2009-10-14 11:14:58 +0000
@@ -65,7 +65,7 @@ struct Query_cache_query;
 struct Query_cache_result;
 class Query_cache;
 struct Query_cache_tls;
-struct st_lex;
+struct LEX;
 
 /**
   This class represents a node in the linked chain of queries

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2009-10-09 14:29:51 +0000
+++ b/sql/sql_lex.cc	2009-10-14 11:14:58 +0000
@@ -2097,7 +2097,7 @@ void st_select_lex::print_limit(THD *thd
   to implement the clean up.
 */
 
-void st_lex::cleanup_lex_after_parse_error(THD *thd)
+void LEX::cleanup_lex_after_parse_error(THD *thd)
 {
   /*
     Delete sphead for the side effect of restoring of the original
@@ -2187,7 +2187,7 @@ void Query_tables_list::destroy_query_ta
   Initialize LEX object.
 
   SYNOPSIS
-    st_lex::st_lex()
+    LEX::LEX()
 
   NOTE
     LEX object initialized with this constructor can be used as part of
@@ -2197,7 +2197,7 @@ void Query_tables_list::destroy_query_ta
     for this.
 */
 
-st_lex::st_lex()
+LEX::LEX()
   :result(0),
    sql_command(SQLCOM_END), option_type(OPT_DEFAULT), is_lex_started(0)
 {
@@ -2214,7 +2214,7 @@ st_lex::st_lex()
   Check whether the merging algorithm can be used on this VIEW
 
   SYNOPSIS
-    st_lex::can_be_merged()
+    LEX::can_be_merged()
 
   DESCRIPTION
     We can apply merge algorithm if it is single SELECT view  with
@@ -2228,7 +2228,7 @@ st_lex::st_lex()
     TRUE  - merge algorithm can be used
 */
 
-bool st_lex::can_be_merged()
+bool LEX::can_be_merged()
 {
   // TODO: do not forget implement case when select_lex.table_list.elements==0
 
@@ -2265,19 +2265,19 @@ bool st_lex::can_be_merged()
   check if command can use VIEW with MERGE algorithm (for top VIEWs)
 
   SYNOPSIS
-    st_lex::can_use_merged()
+    LEX::can_use_merged()
 
   DESCRIPTION
     Only listed here commands can use merge algorithm in top level
     SELECT_LEX (for subqueries will be used merge algorithm if
-    st_lex::can_not_use_merged() is not TRUE).
+    LEX::can_not_use_merged() is not TRUE).
 
   RETURN
     FALSE - command can't use merged VIEWs
     TRUE  - VIEWs with MERGE algorithms can be used
 */
 
-bool st_lex::can_use_merged()
+bool LEX::can_use_merged()
 {
   switch (sql_command)
   {
@@ -2302,18 +2302,18 @@ bool st_lex::can_use_merged()
   Check if command can't use merged views in any part of command
 
   SYNOPSIS
-    st_lex::can_not_use_merged()
+    LEX::can_not_use_merged()
 
   DESCRIPTION
     Temporary table algorithm will be used on all SELECT levels for queries
-    listed here (see also st_lex::can_use_merged()).
+    listed here (see also LEX::can_use_merged()).
 
   RETURN
     FALSE - command can't use merged VIEWs
     TRUE  - VIEWs with MERGE algorithms can be used
 */
 
-bool st_lex::can_not_use_merged()
+bool LEX::can_not_use_merged()
 {
   switch (sql_command)
   {
@@ -2342,7 +2342,7 @@ bool st_lex::can_not_use_merged()
     FALSE no, we need data
 */
 
-bool st_lex::only_view_structure()
+bool LEX::only_view_structure()
 {
   switch (sql_command) {
   case SQLCOM_SHOW_CREATE:
@@ -2371,7 +2371,7 @@ bool st_lex::only_view_structure()
 */
 
 
-bool st_lex::need_correct_ident()
+bool LEX::need_correct_ident()
 {
   switch(sql_command)
   {
@@ -2401,7 +2401,7 @@ bool st_lex::need_correct_ident()
     VIEW_CHECK_CASCADED  CHECK OPTION CASCADED
 */
 
-uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
+uint8 LEX::get_effective_with_check(TABLE_LIST *view)
 {
   if (view->select_lex->master_unit() == &unit &&
       which_check_option_applicable())
@@ -2430,7 +2430,7 @@ uint8 st_lex::get_effective_with_check(T
 */
 
 bool
-st_lex::copy_db_to(char **p_db, size_t *p_db_length) const
+LEX::copy_db_to(char **p_db, size_t *p_db_length) const
 {
   if (sphead)
   {
@@ -2507,7 +2507,7 @@ void st_select_lex_unit::set_limit(st_se
   clause.
 */
 
-void st_lex::set_trg_event_type_for_tables()
+void LEX::set_trg_event_type_for_tables()
 {
   uint8 new_trg_event_map= 0;
 
@@ -2650,7 +2650,7 @@ void st_lex::set_trg_event_type_for_tabl
       In this case link_to_local is set.
 
 */
-TABLE_LIST *st_lex::unlink_first_table(bool *link_to_local)
+TABLE_LIST *LEX::unlink_first_table(bool *link_to_local)
 {
   TABLE_LIST *first;
   if ((first= query_tables))
@@ -2690,7 +2690,7 @@ TABLE_LIST *st_lex::unlink_first_table(b
   table list
 
   SYNOPSYS
-     st_lex::first_lists_tables_same()
+     LEX::first_lists_tables_same()
 
   NOTES
     In many cases (for example, usual INSERT/DELETE/...) the first table of
@@ -2701,7 +2701,7 @@ TABLE_LIST *st_lex::unlink_first_table(b
     the global list first.
 */
 
-void st_lex::first_lists_tables_same()
+void LEX::first_lists_tables_same()
 {
   TABLE_LIST *first_table= (TABLE_LIST*) select_lex.table_list.first;
   if (query_tables != first_table && first_table != 0)
@@ -2737,7 +2737,7 @@ void st_lex::first_lists_tables_same()
     global list
 */
 
-void st_lex::link_first_table_back(TABLE_LIST *first,
+void LEX::link_first_table_back(TABLE_LIST *first,
 				   bool link_to_local)
 {
   if (first)
@@ -2764,7 +2764,7 @@ void st_lex::link_first_table_back(TABLE
   cleanup lex for case when we open table by table for processing
 
   SYNOPSIS
-    st_lex::cleanup_after_one_table_open()
+    LEX::cleanup_after_one_table_open()
 
   NOTE
     This method is mostly responsible for cleaning up of selects lists and
@@ -2772,7 +2772,7 @@ void st_lex::link_first_table_back(TABLE
     to call Query_tables_list::reset_query_tables_list(FALSE).
 */
 
-void st_lex::cleanup_after_one_table_open()
+void LEX::cleanup_after_one_table_open()
 {
   /*
     thd->lex->derived_tables & additional units may be set if we open
@@ -2807,7 +2807,7 @@ void st_lex::cleanup_after_one_table_ope
       backup  Pointer to Query_tables_list instance to be used for backup
 */
 
-void st_lex::reset_n_backup_query_tables_list(Query_tables_list *backup)
+void LEX::reset_n_backup_query_tables_list(Query_tables_list *backup)
 {
   backup->set_query_tables_list(this);
   /*
@@ -2826,7 +2826,7 @@ void st_lex::reset_n_backup_query_tables
       backup  Pointer to Query_tables_list instance used for backup
 */
 
-void st_lex::restore_backup_query_tables_list(Query_tables_list *backup)
+void LEX::restore_backup_query_tables_list(Query_tables_list *backup)
 {
   this->destroy_query_tables_list();
   this->set_query_tables_list(backup);
@@ -2837,14 +2837,14 @@ void st_lex::restore_backup_query_tables
   Checks for usage of routines and/or tables in a parsed statement
 
   SYNOPSIS
-    st_lex:table_or_sp_used()
+    LEX:table_or_sp_used()
 
   RETURN
     FALSE  No routines and tables used
     TRUE   Either or both routines and tables are used.
 */
 
-bool st_lex::table_or_sp_used()
+bool LEX::table_or_sp_used()
 {
   DBUG_ENTER("table_or_sp_used");
 
@@ -3005,7 +3005,7 @@ bool st_select_lex::add_index_hint (THD 
   @retval  FALSE          No, not a management partition command
 */
 
-bool st_lex::is_partition_management() const
+bool LEX::is_partition_management() const
 {
   return (sql_command == SQLCOM_ALTER_TABLE &&
           (alter_info.flags == ALTER_ADD_PARTITION ||

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2009-10-09 14:29:51 +0000
+++ b/sql/sql_lex.h	2009-10-14 11:14:58 +0000
@@ -395,7 +395,7 @@ public:
     Base class for st_select_lex (SELECT_LEX) & 
     st_select_lex_unit (SELECT_LEX_UNIT)
 */
-struct st_lex;
+struct LEX;
 class st_select_lex;
 class st_select_lex_unit;
 class st_select_lex_node {
@@ -465,7 +465,7 @@ public:
   virtual void set_lock_for_tables(thr_lock_type lock_type) {}
 
   friend class st_select_lex_unit;
-  friend bool mysql_new_select(struct st_lex *lex, bool move_down);
+  friend bool mysql_new_select(LEX *lex, bool move_down);
   friend bool mysql_make_view(THD *thd, File_parser *parser,
                               TABLE_LIST *table, uint flags);
 private:
@@ -585,7 +585,7 @@ public:
   /* Saved values of the WHERE and HAVING clauses*/
   Item::cond_result cond_value, having_value;
   /* point on lex in which it was created, used in view subquery detection */
-  st_lex *parent_lex;
+  LEX *parent_lex;
   enum olap_type olap;
   /* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */
   SQL_LIST	      table_list;
@@ -961,7 +961,7 @@ extern const LEX_STRING null_lex_str;
   stored functions/triggers to this list in order to pre-open and lock
   them.
 
-  Also used by st_lex::reset_n_backup/restore_backup_query_tables_list()
+  Also used by LEX::reset_n_backup/restore_backup_query_tables_list()
   methods to save and restore this information.
 */
 
@@ -1550,7 +1550,7 @@ protected:
     Constructor.
     @param lex the LEX structure that represents parts of this statement.
   */
-  Sql_statement(struct st_lex *lex)
+  Sql_statement(LEX *lex)
     : m_lex(lex)
   {}
 
@@ -1575,12 +1575,12 @@ protected:
     with the minimum set of attributes, instead of a LEX structure that
     contains the collection of every possible attribute.
   */
-  struct st_lex *m_lex;
+  LEX *m_lex;
 };
 
 /* The state of the lex parsing. This is saved in the THD struct */
 
-typedef struct st_lex : public Query_tables_list
+struct LEX: public Query_tables_list
 {
   SELECT_LEX_UNIT unit;                         /* most upper unit */
   SELECT_LEX select_lex;                        /* first SELECT_LEX */
@@ -1837,9 +1837,9 @@ typedef struct st_lex : public Query_tab
   */
   bool protect_against_global_read_lock;
 
-  st_lex();
+  LEX();
 
-  virtual ~st_lex()
+  virtual ~LEX()
   {
     destroy_query_tables_list();
     plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements);
@@ -1881,7 +1881,7 @@ typedef struct st_lex : public Query_tab
     Is this update command where 'WHITH CHECK OPTION' clause is important
 
     SYNOPSIS
-      st_lex::which_check_option_applicable()
+      LEX::which_check_option_applicable()
 
     RETURN
       TRUE   have to take 'WHITH CHECK OPTION' clause into account
@@ -1953,7 +1953,7 @@ typedef struct st_lex : public Query_tab
     }
     return FALSE;
   }
-} LEX;
+};
 
 
 /**
@@ -2044,7 +2044,7 @@ public:
 };
 
 
-struct st_lex_local: public st_lex
+struct st_lex_local: public LEX
 {
   static void *operator new(size_t size) throw()
   {

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-10-09 20:01:10 +0000
+++ b/sql/sql_show.cc	2009-10-14 11:14:58 +0000
@@ -3141,7 +3141,7 @@ static int fill_schema_table_from_frm(TH
   {
     tbl.s= share;
     table_list.table= &tbl;
-    table_list.view= (st_lex*) share->is_view;
+    table_list.view= (LEX*) share->is_view;
     res= schema_table->process_table(thd, &table_list, table,
                                      res, db_name, table_name);
     closefrm(&tbl, true);

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-10-09 20:01:10 +0000
+++ b/sql/sql_yacc.yy	2009-10-14 11:14:58 +0000
@@ -502,7 +502,7 @@ Item* handle_sql2003_note184_exception(T
   struct sp_cond_type *spcondtype;
   struct { int vars, conds, hndlrs, curs; } spblock;
   sp_name *spname;
-  struct st_lex *lex;
+  LEX *lex;
   sp_head *sphead;
   struct p_elem_val *p_elem_value;
   enum index_hint_type index_hint;

=== modified file 'sql/structs.h'
--- a/sql/structs.h	2009-06-26 19:57:42 +0000
+++ b/sql/structs.h	2009-10-14 11:14:58 +0000
@@ -16,7 +16,7 @@
 
 /* The old structures from unireg */
 
-struct st_table;
+struct TABLE;
 class Field;
 
 typedef struct st_date_time_format {
@@ -97,7 +97,7 @@ typedef struct st_key {
   union {
     int  bdb_return_if_eq;
   } handler;
-  struct st_table *table;
+  TABLE *table;
 } KEY;
 
 
@@ -121,9 +121,9 @@ class THD;
 class handler;
 
 typedef struct st_read_record {			/* Parameter to read_record */
-  struct st_table *table;			/* Head-form */
+  TABLE *table;                                 /* Head-form */
   handler *file;
-  struct st_table **forms;			/* head and ref forms */
+  TABLE **forms;                                /* head and ref forms */
   int (*read_record)(struct st_read_record *);
   THD *thd;
   SQL_SELECT *select;

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2009-09-10 09:18:29 +0000
+++ b/sql/table.cc	2009-10-14 11:14:58 +0000
@@ -2931,7 +2931,7 @@ table_check_intact(TABLE *table, const u
   Create Item_field for each column in the table.
 
   SYNPOSIS
-    st_table::fill_item_list()
+    TABLE::fill_item_list()
       item_list          a pointer to an empty list used to store items
 
   DESCRIPTION
@@ -2944,7 +2944,7 @@ table_check_intact(TABLE *table, const u
     1                    out of memory
 */
 
-bool st_table::fill_item_list(List<Item> *item_list) const
+bool TABLE::fill_item_list(List<Item> *item_list) const
 {
   /*
     All Item_field's created using a direct pointer to a field
@@ -2964,7 +2964,7 @@ bool st_table::fill_item_list(List<Item>
   Fields of this table.
 
   SYNPOSIS
-    st_table::fill_item_list()
+    TABLE::fill_item_list()
       item_list          a non-empty list with Item_fields
 
   DESCRIPTION
@@ -2974,7 +2974,7 @@ bool st_table::fill_item_list(List<Item>
     is the same as the number of columns in the table.
 */
 
-void st_table::reset_item_list(List<Item> *item_list) const
+void TABLE::reset_item_list(List<Item> *item_list) const
 {
   List_iterator_fast<Item> it(*item_list);
   for (Field **ptr= field; *ptr; ptr++)
@@ -3909,7 +3909,7 @@ const char *Natural_join_column::db_name
     return table_ref->view_db.str;
 
   /*
-    Test that TABLE_LIST::db is the same as st_table_share::db to
+    Test that TABLE_LIST::db is the same as TABLE_SHARE::db to
     ensure consistency. An exception are I_S schema tables, which
     are inconsistent in this respect.
   */
@@ -4128,7 +4128,7 @@ const char *Field_iterator_table_ref::ge
     return natural_join_it.column_ref()->db_name();
 
   /*
-    Test that TABLE_LIST::db is the same as st_table_share::db to
+    Test that TABLE_LIST::db is the same as TABLE_SHARE::db to
     ensure consistency. An exception are I_S schema tables, which
     are inconsistent in this respect.
   */
@@ -4304,7 +4304,7 @@ Field_iterator_table_ref::get_natural_co
 
 /* Reset all columns bitmaps */
 
-void st_table::clear_column_bitmaps()
+void TABLE::clear_column_bitmaps()
 {
   /*
     Reset column read/write usage. It's identical to:
@@ -4325,9 +4325,9 @@ void st_table::clear_column_bitmaps()
   key fields.
 */
 
-void st_table::prepare_for_position()
+void TABLE::prepare_for_position()
 {
-  DBUG_ENTER("st_table::prepare_for_position");
+  DBUG_ENTER("TABLE::prepare_for_position");
 
   if ((file->ha_table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
       s->primary_key < MAX_KEY)
@@ -4346,14 +4346,14 @@ void st_table::prepare_for_position()
   NOTE:
     This changes the bitmap to use the tmp bitmap
     After this, you can't access any other columns in the table until
-    bitmaps are reset, for example with st_table::clear_column_bitmaps()
-    or st_table::restore_column_maps_after_mark_index()
+    bitmaps are reset, for example with TABLE::clear_column_bitmaps()
+    or TABLE::restore_column_maps_after_mark_index()
 */
 
-void st_table::mark_columns_used_by_index(uint index)
+void TABLE::mark_columns_used_by_index(uint index)
 {
   MY_BITMAP *bitmap= &tmp_set;
-  DBUG_ENTER("st_table::mark_columns_used_by_index");
+  DBUG_ENTER("TABLE::mark_columns_used_by_index");
 
   (void) file->extra(HA_EXTRA_KEYREAD);
   bitmap_clear_all(bitmap);
@@ -4374,9 +4374,9 @@ void st_table::mark_columns_used_by_inde
     when calling mark_columns_used_by_index
 */
 
-void st_table::restore_column_maps_after_mark_index()
+void TABLE::restore_column_maps_after_mark_index()
 {
-  DBUG_ENTER("st_table::restore_column_maps_after_mark_index");
+  DBUG_ENTER("TABLE::restore_column_maps_after_mark_index");
 
   key_read= 0;
   (void) file->extra(HA_EXTRA_NO_KEYREAD);
@@ -4390,7 +4390,7 @@ void st_table::restore_column_maps_after
   mark columns used by key, but don't reset other fields
 */
 
-void st_table::mark_columns_used_by_index_no_reset(uint index,
+void TABLE::mark_columns_used_by_index_no_reset(uint index,
                                                    MY_BITMAP *bitmap)
 {
   KEY_PART_INFO *key_part= key_info[index].key_part;
@@ -4409,7 +4409,7 @@ void st_table::mark_columns_used_by_inde
     always set and sometimes read.
 */
 
-void st_table::mark_auto_increment_column()
+void TABLE::mark_auto_increment_column()
 {
   DBUG_ASSERT(found_next_number_field);
   /*
@@ -4442,7 +4442,7 @@ void st_table::mark_auto_increment_colum
     retrieve the row again.
 */
 
-void st_table::mark_columns_needed_for_delete()
+void TABLE::mark_columns_needed_for_delete()
 {
   if (triggers)
     triggers->mark_fields_used(TRG_EVENT_DELETE);
@@ -4492,7 +4492,7 @@ void st_table::mark_columns_needed_for_d
     retrieve the row again.
 */
 
-void st_table::mark_columns_needed_for_update()
+void TABLE::mark_columns_needed_for_update()
 {
   DBUG_ENTER("mark_columns_needed_for_update");
   if (triggers)
@@ -4535,7 +4535,7 @@ void st_table::mark_columns_needed_for_u
   as changed.
 */
 
-void st_table::mark_columns_needed_for_insert()
+void TABLE::mark_columns_needed_for_insert()
 {
   if (triggers)
   {
@@ -4565,7 +4565,7 @@ void st_table::mark_columns_needed_for_i
     TABLEs. Each of these TABLEs is called a part of a MERGE table.
 */
 
-bool st_table::is_children_attached(void)
+bool TABLE::is_children_attached(void)
 {
   return((child_l && children_attached) ||
          (parent && parent->children_attached));
@@ -4629,9 +4629,9 @@ Item_subselect *TABLE_LIST::containing_s
   DESCRIPTION
     The parser collects the index hints for each table in a "tagged list" 
     (TABLE_LIST::index_hints). Using the information in this tagged list
-    this function sets the members st_table::keys_in_use_for_query, 
-    st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
-    st_table::force_index and st_table::covering_keys.
+    this function sets the members TABLE::keys_in_use_for_query, 
+    TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by,
+    TABLE::force_index and TABLE::covering_keys.
 
     Current implementation of the runtime does not allow mixing FORCE INDEX
     and USE INDEX, so this is checked here. Then the FORCE INDEX list 

=== modified file 'sql/table.h'
--- a/sql/table.h	2009-08-21 14:41:48 +0000
+++ b/sql/table.h	2009-10-14 11:14:58 +0000
@@ -290,9 +290,9 @@ TABLE_CATEGORY get_table_category(const 
   instance of table share per one table in the database.
 */
 
-typedef struct st_table_share
+struct TABLE_SHARE
 {
-  st_table_share() {}                    /* Remove gcc warning */
+  TABLE_SHARE() {}                    /* Remove gcc warning */
 
   /** Category of this table. */
   TABLE_CATEGORY table_category;
@@ -305,11 +305,7 @@ typedef struct st_table_share
   TYPELIB *intervals;			/* pointer to interval info */
   pthread_mutex_t mutex;                /* For locking the share  */
   pthread_cond_t cond;			/* To signal that share is ready */
-  struct st_table_share *next,		/* Link to unused shares */
-    **prev;
-#ifdef NOT_YET
-  struct st_table *open_tables;		/* link to open tables */
-#endif
+  TABLE_SHARE *next, **prev;            /* Link to unused shares */
 
   /* The following is copied to each TABLE on OPEN */
   Field **field;
@@ -592,7 +588,7 @@ typedef struct st_table_share
     return (tmp_table == SYSTEM_TMP_TABLE || is_view) ? 0 : table_map_id;
   }
 
-} TABLE_SHARE;
+};
 
 
 extern ulong refresh_version;
@@ -605,19 +601,16 @@ enum index_hint_type
   INDEX_HINT_FORCE
 };
 
-struct st_table {
-  st_table() {}                               /* Remove gcc warning */
+struct TABLE
+{
+  TABLE() {}                               /* Remove gcc warning */
 
   TABLE_SHARE	*s;
   handler	*file;
-#ifdef NOT_YET
-  struct st_table *used_next, **used_prev;	/* Link to used tables */
-  struct st_table *open_next, **open_prev;	/* Link to open tables */
-#endif
-  struct st_table *next, *prev;
+  TABLE *next, *prev;
 
   /* For the below MERGE related members see top comment in ha_myisammrg.cc */
-  struct st_table *parent;          /* Set in MERGE child.  Ptr to parent */
+  TABLE *parent;                    /* Set in MERGE child.  Ptr to parent */
   TABLE_LIST      *child_l;         /* Set in MERGE parent. List of children */
   TABLE_LIST      **child_last_l;   /* Set in MERGE parent. End of list */
 
@@ -999,7 +992,6 @@ typedef struct st_schema_table
 /** The threshold size a blob field buffer before it is freed */
 #define MAX_TDC_BLOB_SIZE 65536
 
-struct st_lex;
 class select_union;
 class TMP_TABLE_PARAM;
 
@@ -1077,6 +1069,7 @@ public:
          (TABLE_LIST::join_using_fields != NULL)
 */
 
+struct LEX;
 class Index_hint;
 struct TABLE_LIST
 {
@@ -1197,7 +1190,7 @@ struct TABLE_LIST
   TMP_TABLE_PARAM *schema_table_param;
   /* link to select_lex where this table was used */
   st_select_lex	*select_lex;
-  st_lex	*view;			/* link on VIEW lex for merging */
+  LEX *view;                    /* link on VIEW lex for merging */
   Field_translator *field_translation;	/* array of VIEW fields */
   /* pointer to element after last one in translation table above */
   Field_translator *field_translation_end;
@@ -1412,9 +1405,9 @@ struct TABLE_LIST
   Item_subselect *containing_subselect();
 
   /* 
-    Compiles the tagged hints list and fills up st_table::keys_in_use_for_query,
-    st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
-    st_table::force_index and st_table::covering_keys.
+    Compiles the tagged hints list and fills up TABLE::keys_in_use_for_query,
+    TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by,
+    TABLE::force_index and TABLE::covering_keys.
   */
   bool process_index_hints(TABLE *table);
 

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2009-09-23 20:15:22 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2009-10-14 11:14:58 +0000
@@ -4497,7 +4497,7 @@ calc_row_difference(
 	upd_t*		uvect,		/*!< in/out: update vector */
 	uchar*		old_row,	/*!< in: old row in MySQL format */
 	uchar*		new_row,	/*!< in: new row in MySQL format */
-	struct st_table* table,		/*!< in: table in MySQL data
+	TABLE*          table,		/*!< in: table in MySQL data
 					dictionary */
 	uchar*		upd_buff,	/*!< in: buffer to use */
 	ulint		buff_len,	/*!< in: buffer length */

=== modified file 'storage/innobase/include/handler0alter.h'
--- a/storage/innobase/include/handler0alter.h	2009-05-27 09:45:59 +0000
+++ b/storage/innobase/include/handler0alter.h	2009-10-14 11:14:58 +0000
@@ -27,7 +27,7 @@ UNIV_INTERN
 void
 innobase_rec_to_mysql(
 /*==================*/
-	TABLE*			table,		/*!< in/out: MySQL table */
+	struct TABLE*		table,		/*!< in/out: MySQL table */
 	const rec_t*		rec,		/*!< in: record */
 	const dict_index_t*	index,		/*!< in: index */
 	const ulint*		offsets);	/*!< in: rec_get_offsets(
@@ -39,4 +39,4 @@ UNIV_INTERN
 void
 innobase_rec_reset(
 /*===============*/
-	TABLE*			table);		/*!< in/out: MySQL table */
+	struct TABLE*		table);		/*!< in/out: MySQL table */

=== modified file 'storage/innobase/include/row0merge.h'
--- a/storage/innobase/include/row0merge.h	2009-05-27 09:45:59 +0000
+++ b/storage/innobase/include/row0merge.h	2009-10-14 11:14:58 +0000
@@ -191,7 +191,7 @@ row_merge_build_indexes(
 					unless creating a PRIMARY KEY */
 	dict_index_t**	indexes,	/*!< in: indexes to be created */
 	ulint		n_indexes,	/*!< in: size of indexes[] */
-	TABLE*		table);		/*!< in/out: MySQL table, for
+	struct TABLE*	table);		/*!< in/out: MySQL table, for
 					reporting erroneous key value
 					if applicable */
 #endif /* row0merge.h */

=== modified file 'storage/innobase/include/row0types.h'
--- a/storage/innobase/include/row0types.h	2009-05-27 09:45:59 +0000
+++ b/storage/innobase/include/row0types.h	2009-10-14 11:14:58 +0000
@@ -54,6 +54,6 @@ typedef	struct purge_node_struct purge_n
 typedef struct row_ext_struct row_ext_t;
 
 /* MySQL data types */
-typedef struct st_table TABLE;
+struct TABLE;
 
 #endif

=== modified file 'storage/innobase/row/row0merge.c'
--- a/storage/innobase/row/row0merge.c	2009-07-30 12:42:56 +0000
+++ b/storage/innobase/row/row0merge.c	2009-10-14 11:14:58 +0000
@@ -397,7 +397,7 @@ row_merge_buf_add(
 /** Structure for reporting duplicate records. */
 struct row_merge_dup_struct {
 	const dict_index_t*	index;		/*!< index being sorted */
-	TABLE*			table;		/*!< MySQL table object */
+	struct TABLE*		table;		/*!< MySQL table object */
 	ulint			n_dup;		/*!< number of duplicates */
 };
 
@@ -1075,7 +1075,7 @@ ulint
 row_merge_read_clustered_index(
 /*===========================*/
 	trx_t*			trx,	/*!< in: transaction */
-	TABLE*			table,	/*!< in/out: MySQL table object,
+	struct TABLE*		table,	/*!< in/out: MySQL table object,
 					for reporting erroneous records */
 	const dict_table_t*	old_table,/*!< in: table where rows are
 					read from */
@@ -1351,7 +1351,7 @@ row_merge_blocks(
 	ulint*			foffs1,	/*!< in/out: offset of second
 					source list in the file */
 	merge_file_t*		of,	/*!< in/out: output file */
-	TABLE*			table)	/*!< in/out: MySQL table, for
+	struct TABLE*		table)	/*!< in/out: MySQL table, for
 					reporting erroneous key value
 					if applicable */
 {
@@ -1450,7 +1450,7 @@ row_merge(
 	ulint			half,	/*!< in: half the file */
 	row_merge_block_t*	block,	/*!< in/out: 3 buffers */
 	int*			tmpfd,	/*!< in/out: temporary file handle */
-	TABLE*			table)	/*!< in/out: MySQL table, for
+	struct TABLE*		table)	/*!< in/out: MySQL table, for
 					reporting erroneous key value
 					if applicable */
 {
@@ -1513,7 +1513,7 @@ row_merge_sort(
 					index entries */
 	row_merge_block_t*	block,	/*!< in/out: 3 buffers */
 	int*			tmpfd,	/*!< in/out: temporary file handle */
-	TABLE*			table)	/*!< in/out: MySQL table, for
+	struct TABLE*		table)	/*!< in/out: MySQL table, for
 					reporting erroneous key value
 					if applicable */
 {
@@ -2278,7 +2278,7 @@ row_merge_build_indexes(
 					unless creating a PRIMARY KEY */
 	dict_index_t**	indexes,	/*!< in: indexes to be created */
 	ulint		n_indexes,	/*!< in: size of indexes[] */
-	TABLE*		table)		/*!< in/out: MySQL table, for
+	struct TABLE*	table)		/*!< in/out: MySQL table, for
 					reporting erroneous key value
 					if applicable */
 {


Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20091014111458-5a8mon2skx1wat1a.bundle
Thread
bzr push into mysql-5.5.0-next-mr-runtime branch (kostja:2917 to 2918)Konstantin Osipov14 Oct