diff options
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index aca84f1bcb3..07005a8e140 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -943,3 +943,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; +} |