summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r--sql/mysql_priv.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 65451ca40b5..28446ed746f 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -951,3 +951,24 @@ compare_func_creator comp_le_creator(bool invert);
compare_func_creator comp_lt_creator(bool invert);
compare_func_creator comp_ne_creator(bool invert);
+/*
+ clean/setup table fields and map
+
+ SYNOPSYS
+ setup_table_map()
+ table - TABLE structure pointer (which should be setup)
+ table_list TABLE_LIST structure pointer (owner of TABLE)
+ tablenr - table number
+*/
+inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
+{
+ table->used_fields= 0;
+ table->const_table= 0;
+ table->outer_join= table->null_row= 0;
+ table->status= STATUS_NO_RECORD;
+ table->keys_in_use_for_query= table->keys_in_use;
+ table->maybe_null= test(table->outer_join= table_list->outer_join);
+ table->tablenr= tablenr;
+ table->map= (table_map) 1 << tablenr;
+ table->force_index= table_list->force_index;
+}