Commit 392b283f authored by kostja@bodhi.(none)'s avatar kostja@bodhi.(none)

Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime

into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
parents a7b05cb7 a33bc2c2
...@@ -5807,7 +5807,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) ...@@ -5807,7 +5807,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
if (!arg->fixed) if (!arg->fixed)
{ {
bool res; bool res;
st_table_list *orig_next_table= context->last_name_resolution_table; TABLE_LIST *orig_next_table= context->last_name_resolution_table;
context->last_name_resolution_table= context->first_name_resolution_table; context->last_name_resolution_table= context->first_name_resolution_table;
res= arg->fix_fields(thd, &arg); res= arg->fix_fields(thd, &arg);
context->last_name_resolution_table= orig_next_table; context->last_name_resolution_table= orig_next_table;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#endif #endif
class Protocol; class Protocol;
struct st_table_list; struct TABLE_LIST;
void item_init(void); /* Init item functions */ void item_init(void); /* Init item functions */
class Item_field; class Item_field;
......
...@@ -455,9 +455,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout); ...@@ -455,9 +455,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#define SHOW_LOG_STATUS_FREE "FREE" #define SHOW_LOG_STATUS_FREE "FREE"
#define SHOW_LOG_STATUS_INUSE "IN USE" #define SHOW_LOG_STATUS_INUSE "IN USE"
struct st_table_list; struct TABLE_LIST;
class String; class String;
void view_store_options(THD *thd, st_table_list *table, String *buff); void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
/* Options to add_table_to_list() */ /* Options to add_table_to_list() */
#define TL_OPTION_UPDATING 1 #define TL_OPTION_UPDATING 1
...@@ -1104,7 +1104,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr); ...@@ -1104,7 +1104,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr);
void close_temporary_tables(THD *thd); void close_temporary_tables(THD *thd);
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables); void close_tables_for_reopen(THD *thd, TABLE_LIST **tables);
TABLE_LIST *find_table_in_list(TABLE_LIST *table, TABLE_LIST *find_table_in_list(TABLE_LIST *table,
st_table_list *TABLE_LIST::*link, TABLE_LIST *TABLE_LIST::*link,
const char *db_name, const char *db_name,
const char *table_name); const char *table_name);
TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
......
...@@ -848,7 +848,7 @@ void close_temporary_tables(THD *thd) ...@@ -848,7 +848,7 @@ void close_temporary_tables(THD *thd)
*/ */
TABLE_LIST *find_table_in_list(TABLE_LIST *table, TABLE_LIST *find_table_in_list(TABLE_LIST *table,
st_table_list *TABLE_LIST::*link, TABLE_LIST *TABLE_LIST::*link,
const char *db_name, const char *db_name,
const char *table_name) const char *table_name)
{ {
......
...@@ -1965,7 +1965,7 @@ bool st_lex::need_correct_ident() ...@@ -1965,7 +1965,7 @@ bool st_lex::need_correct_ident()
VIEW_CHECK_CASCADED CHECK OPTION CASCADED VIEW_CHECK_CASCADED CHECK OPTION CASCADED
*/ */
uint8 st_lex::get_effective_with_check(st_table_list *view) uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
{ {
if (view->select_lex->master_unit() == &unit && if (view->select_lex->master_unit() == &unit &&
which_check_option_applicable()) which_check_option_applicable())
......
...@@ -1198,7 +1198,7 @@ typedef struct st_lex : public Query_tables_list ...@@ -1198,7 +1198,7 @@ typedef struct st_lex : public Query_tables_list
bool can_not_use_merged(); bool can_not_use_merged();
bool only_view_structure(); bool only_view_structure();
bool need_correct_ident(); bool need_correct_ident();
uint8 get_effective_with_check(st_table_list *view); uint8 get_effective_with_check(TABLE_LIST *view);
/* /*
Is this update command where 'WHITH CHECK OPTION' clause is important Is this update command where 'WHITH CHECK OPTION' clause is important
......
...@@ -15395,11 +15395,11 @@ static void print_join(THD *thd, String *str, List<TABLE_LIST> *tables) ...@@ -15395,11 +15395,11 @@ static void print_join(THD *thd, String *str, List<TABLE_LIST> *tables)
Print table as it should be in join list Print table as it should be in join list
SYNOPSIS SYNOPSIS
st_table_list::print(); TABLE_LIST::print();
str string where table should bbe printed str string where table should bbe printed
*/ */
void st_table_list::print(THD *thd, String *str) void TABLE_LIST::print(THD *thd, String *str)
{ {
if (nested_join) if (nested_join)
{ {
......
...@@ -2429,7 +2429,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond) ...@@ -2429,7 +2429,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
} }
static int get_schema_tables_record(THD *thd, struct st_table_list *tables, static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
...@@ -2619,7 +2619,7 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables, ...@@ -2619,7 +2619,7 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
} }
static int get_schema_column_record(THD *thd, struct st_table_list *tables, static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
...@@ -3061,7 +3061,7 @@ err: ...@@ -3061,7 +3061,7 @@ err:
} }
static int get_schema_stat_record(THD *thd, struct st_table_list *tables, static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
...@@ -3151,7 +3151,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables, ...@@ -3151,7 +3151,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
} }
static int get_schema_views_record(THD *thd, struct st_table_list *tables, static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
...@@ -3263,7 +3263,7 @@ bool store_constraints(THD *thd, TABLE *table, const char *db, ...@@ -3263,7 +3263,7 @@ bool store_constraints(THD *thd, TABLE *table, const char *db,
} }
static int get_schema_constraints_record(THD *thd, struct st_table_list *tables, static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
...@@ -3359,7 +3359,7 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, ...@@ -3359,7 +3359,7 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db,
} }
static int get_schema_triggers_record(THD *thd, struct st_table_list *tables, static int get_schema_triggers_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
...@@ -3426,7 +3426,7 @@ void store_key_column_usage(TABLE *table, const char*db, const char *tname, ...@@ -3426,7 +3426,7 @@ void store_key_column_usage(TABLE *table, const char*db, const char *tname,
static int get_schema_key_column_usage_record(THD *thd, static int get_schema_key_column_usage_record(THD *thd,
struct st_table_list *tables, TABLE_LIST *tables,
TABLE *table, bool res, TABLE *table, bool res,
const char *base_name, const char *base_name,
const char *file_name) const char *file_name)
......
...@@ -47,7 +47,6 @@ typedef struct st_udf_func ...@@ -47,7 +47,6 @@ typedef struct st_udf_func
} udf_func; } udf_func;
class Item_result_field; class Item_result_field;
struct st_table_list;
class udf_handler :public Sql_alloc class udf_handler :public Sql_alloc
{ {
......
This diff is collapsed.
...@@ -237,7 +237,7 @@ struct st_table { ...@@ -237,7 +237,7 @@ struct st_table {
/* Table's triggers, 0 if there are no of them */ /* Table's triggers, 0 if there are no of them */
Table_triggers_list *triggers; Table_triggers_list *triggers;
struct st_table_list *pos_in_table_list;/* Element referring to this table */ TABLE_LIST *pos_in_table_list;/* Element referring to this table */
ORDER *group; ORDER *group;
const char *alias; /* alias or table name */ const char *alias; /* alias or table name */
uchar *null_flags; uchar *null_flags;
...@@ -392,7 +392,7 @@ typedef struct st_field_info ...@@ -392,7 +392,7 @@ typedef struct st_field_info
} ST_FIELD_INFO; } ST_FIELD_INFO;
struct st_table_list; struct TABLE_LIST;
typedef class Item COND; typedef class Item COND;
typedef struct st_schema_table typedef struct st_schema_table
...@@ -400,12 +400,12 @@ typedef struct st_schema_table ...@@ -400,12 +400,12 @@ typedef struct st_schema_table
const char* table_name; const char* table_name;
ST_FIELD_INFO *fields_info; ST_FIELD_INFO *fields_info;
/* Create information_schema table */ /* Create information_schema table */
TABLE *(*create_table) (THD *thd, struct st_table_list *table_list); TABLE *(*create_table) (THD *thd, TABLE_LIST *table_list);
/* Fill table with data */ /* Fill table with data */
int (*fill_table) (THD *thd, struct st_table_list *tables, COND *cond); int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond);
/* Handle fileds for old SHOW */ /* Handle fileds for old SHOW */
int (*old_format) (THD *thd, struct st_schema_table *schema_table); int (*old_format) (THD *thd, struct st_schema_table *schema_table);
int (*process_table) (THD *thd, struct st_table_list *tables, int (*process_table) (THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, const char *base_name, TABLE *table, bool res, const char *base_name,
const char *file_name); const char *file_name);
int idx_field1, idx_field2; int idx_field1, idx_field2;
...@@ -438,7 +438,7 @@ struct st_lex; ...@@ -438,7 +438,7 @@ struct st_lex;
class select_union; class select_union;
class TMP_TABLE_PARAM; class TMP_TABLE_PARAM;
Item *create_view_field(THD *thd, st_table_list *view, Item **field_ref, Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
const char *name); const char *name);
struct Field_translator struct Field_translator
...@@ -459,7 +459,7 @@ class Natural_join_column: public Sql_alloc ...@@ -459,7 +459,7 @@ class Natural_join_column: public Sql_alloc
public: public:
Field_translator *view_field; /* Column reference of merge view. */ Field_translator *view_field; /* Column reference of merge view. */
Field *table_field; /* Column reference of table or temp view. */ Field *table_field; /* Column reference of table or temp view. */
st_table_list *table_ref; /* Original base table/view reference. */ TABLE_LIST *table_ref; /* Original base table/view reference. */
/* /*
True if a common join column of two NATURAL/USING join operands. Notice True if a common join column of two NATURAL/USING join operands. Notice
that when we have a hierarchy of nested NATURAL/USING joins, a column can that when we have a hierarchy of nested NATURAL/USING joins, a column can
...@@ -469,8 +469,8 @@ public: ...@@ -469,8 +469,8 @@ public:
*/ */
bool is_common; bool is_common;
public: public:
Natural_join_column(Field_translator *field_param, st_table_list *tab); Natural_join_column(Field_translator *field_param, TABLE_LIST *tab);
Natural_join_column(Field *field_param, st_table_list *tab); Natural_join_column(Field *field_param, TABLE_LIST *tab);
const char *name(); const char *name();
Item *create_item(THD *thd); Item *create_item(THD *thd);
Field *field(); Field *field();
...@@ -512,17 +512,17 @@ public: ...@@ -512,17 +512,17 @@ public:
(TABLE_LIST::join_using_fields != NULL) (TABLE_LIST::join_using_fields != NULL)
*/ */
typedef struct st_table_list struct TABLE_LIST
{ {
st_table_list() {} /* Remove gcc warning */ TABLE_LIST() {} /* Remove gcc warning */
/* /*
List of tables local to a subquery (used by SQL_LIST). Considers List of tables local to a subquery (used by SQL_LIST). Considers
views as leaves (unlike 'next_leaf' below). Created at parse time views as leaves (unlike 'next_leaf' below). Created at parse time
in st_select_lex::add_table_to_list() -> table_list.link_in_list(). in st_select_lex::add_table_to_list() -> table_list.link_in_list().
*/ */
struct st_table_list *next_local; TABLE_LIST *next_local;
/* link in a global list of all queries tables */ /* link in a global list of all queries tables */
struct st_table_list *next_global, **prev_global; TABLE_LIST *next_global, **prev_global;
char *db, *alias, *table_name, *schema_table_name; char *db, *alias, *table_name, *schema_table_name;
char *option; /* Used by cache index */ char *option; /* Used by cache index */
Item *on_expr; /* Used with outer join */ Item *on_expr; /* Used with outer join */
...@@ -542,7 +542,7 @@ typedef struct st_table_list ...@@ -542,7 +542,7 @@ typedef struct st_table_list
'this' represents a NATURAL or USING join operation. Thus after 'this' represents a NATURAL or USING join operation. Thus after
parsing 'this' is a NATURAL/USING join iff (natural_join != NULL). parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
*/ */
struct st_table_list *natural_join; TABLE_LIST *natural_join;
/* /*
True if 'this' represents a nested join that is a NATURAL JOIN. True if 'this' represents a nested join that is a NATURAL JOIN.
For one of the operands of 'this', the member 'natural_join' points For one of the operands of 'this', the member 'natural_join' points
...@@ -566,7 +566,7 @@ typedef struct st_table_list ...@@ -566,7 +566,7 @@ typedef struct st_table_list
base tables. All of these TABLE_LIST instances contain a base tables. All of these TABLE_LIST instances contain a
materialized list of columns. The list is local to a subquery. materialized list of columns. The list is local to a subquery.
*/ */
struct st_table_list *next_name_resolution_table; TABLE_LIST *next_name_resolution_table;
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */ /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
List<String> *use_index, *ignore_index; List<String> *use_index, *ignore_index;
TABLE *table; /* opened table */ TABLE *table; /* opened table */
...@@ -582,7 +582,7 @@ typedef struct st_table_list ...@@ -582,7 +582,7 @@ typedef struct st_table_list
here it will be reference of first occurrence of t1 to second (as you here it will be reference of first occurrence of t1 to second (as you
can see this lists can't be merged) can see this lists can't be merged)
*/ */
st_table_list *correspondent_table; TABLE_LIST *correspondent_table;
st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */ st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */ ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex; st_select_lex *schema_select_lex;
...@@ -603,20 +603,20 @@ typedef struct st_table_list ...@@ -603,20 +603,20 @@ typedef struct st_table_list
does not include the tables of subqueries used in the view. Is set only does not include the tables of subqueries used in the view. Is set only
for merged views. for merged views.
*/ */
st_table_list *merge_underlying_list; TABLE_LIST *merge_underlying_list;
/* /*
- 0 for base tables - 0 for base tables
- in case of the view it is the list of all (not only underlying - in case of the view it is the list of all (not only underlying
tables but also used in subquery ones) tables of the view. tables but also used in subquery ones) tables of the view.
*/ */
List<st_table_list> *view_tables; List<TABLE_LIST> *view_tables;
/* most upper view this table belongs to */ /* most upper view this table belongs to */
st_table_list *belong_to_view; TABLE_LIST *belong_to_view;
/* /*
The view directly referencing this table The view directly referencing this table
(non-zero only for merged underlying tables of a view). (non-zero only for merged underlying tables of a view).
*/ */
st_table_list *referencing_view; TABLE_LIST *referencing_view;
/* /*
Security context (non-zero only for tables which belong Security context (non-zero only for tables which belong
to view with SQL SECURITY DEFINER) to view with SQL SECURITY DEFINER)
...@@ -633,7 +633,7 @@ typedef struct st_table_list ...@@ -633,7 +633,7 @@ typedef struct st_table_list
leaves. Created in setup_tables() -> make_leaves_list(). leaves. Created in setup_tables() -> make_leaves_list().
*/ */
bool allowed_show; bool allowed_show;
st_table_list *next_leaf; TABLE_LIST *next_leaf;
Item *where; /* VIEW WHERE clause condition */ Item *where; /* VIEW WHERE clause condition */
Item *check_option; /* WITH CHECK OPTION condition */ Item *check_option; /* WITH CHECK OPTION condition */
LEX_STRING query; /* text of (CRETE/SELECT) statement */ LEX_STRING query; /* text of (CRETE/SELECT) statement */
...@@ -673,8 +673,8 @@ typedef struct st_table_list ...@@ -673,8 +673,8 @@ typedef struct st_table_list
table_map dep_tables; /* tables the table depends on */ table_map dep_tables; /* tables the table depends on */
table_map on_expr_dep_tables; /* tables on expression depends on */ table_map on_expr_dep_tables; /* tables on expression depends on */
struct st_nested_join *nested_join; /* if the element is a nested join */ struct st_nested_join *nested_join; /* if the element is a nested join */
st_table_list *embedding; /* nested join containing the table */ TABLE_LIST *embedding; /* nested join containing the table */
List<struct st_table_list> *join_list;/* join list the table belongs to */ List<TABLE_LIST> *join_list;/* join list the table belongs to */
bool cacheable_table; /* stop PS caching */ bool cacheable_table; /* stop PS caching */
/* used in multi-upd/views privilege check */ /* used in multi-upd/views privilege check */
bool table_in_first_from_clause; bool table_in_first_from_clause;
...@@ -714,15 +714,15 @@ typedef struct st_table_list ...@@ -714,15 +714,15 @@ typedef struct st_table_list
!table; !table;
} }
void print(THD *thd, String *str); void print(THD *thd, String *str);
bool check_single_table(st_table_list **table, table_map map, bool check_single_table(TABLE_LIST **table, table_map map,
st_table_list *view); TABLE_LIST *view);
bool set_insert_values(MEM_ROOT *mem_root); bool set_insert_values(MEM_ROOT *mem_root);
void hide_view_error(THD *thd); void hide_view_error(THD *thd);
st_table_list *find_underlying_table(TABLE *table); TABLE_LIST *find_underlying_table(TABLE *table);
st_table_list *first_leaf_for_name_resolution(); TABLE_LIST *first_leaf_for_name_resolution();
st_table_list *last_leaf_for_name_resolution(); TABLE_LIST *last_leaf_for_name_resolution();
bool is_leaf_for_name_resolution(); bool is_leaf_for_name_resolution();
inline st_table_list *top_table() inline TABLE_LIST *top_table()
{ return belong_to_view ? belong_to_view : this; } { return belong_to_view ? belong_to_view : this; }
inline bool prepare_check_option(THD *thd) inline bool prepare_check_option(THD *thd)
{ {
...@@ -759,7 +759,7 @@ private: ...@@ -759,7 +759,7 @@ private:
Cleanup for re-execution in a prepared statement or a stored Cleanup for re-execution in a prepared statement or a stored
procedure. procedure.
*/ */
} TABLE_LIST; };
class Item; class Item;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment