summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/table.h b/sql/table.h
index f95be1fcccb..21ea31f832d 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -224,6 +224,12 @@ struct st_table {
struct st_lex;
struct select_union;
+struct Field_translator
+{
+ Item *item;
+ const char *name;
+};
+
typedef struct st_table_list
{
/* link in a local table list (used by SQL_LIST) */
@@ -255,11 +261,13 @@ 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;
+ /* list of join table tree leaves */
+ st_table_list *next_leaf;
Item *where; /* VIEW WHERE clause condition */
Item *check_option; /* WITH CHECK OPTION condition */
LEX_STRING query; /* text of (CRETE/SELECT) statement */
@@ -279,6 +287,7 @@ typedef struct st_table_list
*/
uint8 effective_with_check;
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 */
@@ -313,6 +322,11 @@ typedef struct st_table_list
void cleanup_items();
bool placeholder() {return derived || view; }
void print(THD *thd, String *str);
+ void save_and_clear_want_privilege();
+ void restore_want_privilege();
+ bool check_single_table(st_table_list **table, table_map map);
+ bool set_insert_values(MEM_ROOT *mem_root);
+ void clear_insert_values();
} TABLE_LIST;
class Item;
@@ -347,14 +361,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; }
};