summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/table.h b/sql/table.h
index f31c3c21d63..b5139919889 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -190,6 +190,13 @@ struct st_table {
struct st_lex;
+
+struct Field_translator
+{
+ Item *item;
+ const char *name;
+};
+
typedef struct st_table_list
{
/* link in a local table list (used by SQL_LIST) */
@@ -215,13 +222,15 @@ typedef struct st_table_list
/* link to select_lex where this table was used */
st_select_lex *select_lex;
st_lex *view; /* link on VIEW lex for merging */
- Item **field_translation; /* array of VIEW fields */
+ Field_translator *field_translation; /* array of VIEW fields */
/* ancestor of this table (VIEW merge algorithm) */
st_table_list *ancestor;
/* most upper view this table belongs to */
st_table_list *belong_to_view;
/* next_global before adding VIEW tables */
st_table_list *old_next;
+ /* list of join table tree leaves */
+ st_table_list *next_leaf;
Item *where; /* VIEW WHERE clause condition */
LEX_STRING query; /* text of (CRETE/SELECT) statement */
LEX_STRING md5; /* md5 of query tesxt */
@@ -234,6 +243,7 @@ typedef struct st_table_list
ulonglong revision; /* revision control number */
ulonglong algorithm; /* 0 any, 1 tmp tables , 2 merging */
uint effective_algorithm; /* which algorithm was really used */
+ uint privilege_backup; /* place for saving privileges */
GRANT_INFO grant;
thr_lock_type lock_type;
uint outer_join; /* Which join type */
@@ -265,6 +275,8 @@ typedef struct st_table_list
bool setup_ancestor(THD *thd, Item **conds);
bool placeholder() {return derived || view; }
void print(THD *thd, String *str);
+ void save_and_clear_want_privilege();
+ void restore_want_privilege();
inline st_table_list *next_independent()
{
if (view)
@@ -305,14 +317,14 @@ public:
class Field_iterator_view: public Field_iterator
{
- Item **ptr, **array_end;
+ Field_translator *ptr, *array_end;
public:
Field_iterator_view() :ptr(0), array_end(0) {}
void set(TABLE_LIST *table);
void next() { ptr++; }
bool end_of_fields() { return ptr == array_end; }
const char *name();
- Item *item(THD *thd) { return *ptr; }
+ Item *item(THD *thd) { return ptr->item; }
Field *field() { return 0; }
};