1 #ifndef STRUCTS_INCLUDED 
    2 #define STRUCTS_INCLUDED 
   23 #include "sql_plugin.h"                          
   43   uchar ref[MAX_REFLENGTH];             
 
   44   uchar dupp_ref[MAX_REFLENGTH];        
 
   50   ulonglong data_file_length;           
 
   51   ulonglong max_data_file_length;       
 
   52   ulonglong index_file_length;
 
   53   ulonglong max_index_file_length;
 
   54   ulonglong delete_length;              
 
   55   ulonglong auto_increment_value;
 
   60   ulong mean_rec_length;                
 
  107   enum  ha_key_alg algorithm;
 
  129     int  bdb_return_if_eq;
 
  140   enum thr_lock_type lock_type;         
 
  141   bool not_exists_optimize;
 
  146   bool impossible_range;
 
  156 typedef enum enum_mysql_timestamp_type timestamp_type;
 
  160   ulong year,month,day,hour;
 
  161   ulonglong minute,second,second_part;
 
  167   const char *format_name;
 
  168   const char *date_format;
 
  169   const char *datetime_format;
 
  170   const char *time_format;
 
  173 extern const char *show_comp_option_name[];
 
  178   LEX_STRING user, host, password, plugin, auth;
 
  179   bool uses_identified_by_clause;
 
  180   bool uses_identified_with_clause;
 
  181   bool uses_authentication_string_clause;
 
  182   bool uses_identified_by_password_clause;
 
  206   enum {QUERIES_PER_HOUR= 1, UPDATES_PER_HOUR= 2, CONNECTIONS_PER_HOUR= 4,
 
  207         USER_CONNECTIONS= 8};
 
  208   uint specified_limits;
 
  239   uint conn_per_hour, updates, questions;
 
  245 #define REG_MAKE_DUPP           1        
  246 #define REG_NEW_RECORD          2        
  250 #define REG_CLEAR_AFTER_WRITE   32 
  251 #define REG_MAY_BE_UPDATED      64 
  252 #define REG_AUTO_UPDATE         64       
  253 #define REG_OVERWRITE           128 
  254 #define REG_SKIP_DUP            256 
  263 #define STATUS_GARBAGE          1 
  268 #define STATUS_NOT_FOUND        2 
  270 #define STATUS_UPDATED          16 
  275 #define STATUS_NULL_ROW         32 
  277 #define STATUS_DELETED          64 
  290   ulonglong interval_min;
 
  291   ulonglong interval_values;
 
  292   ulonglong  interval_max;    
 
  299     return  ((value >= interval_min) && (value < interval_max));
 
  302   void replace(ulonglong start, ulonglong val, ulonglong incr)
 
  305     interval_values= val;
 
  306     interval_max=    (val == ULONGLONG_MAX) ? val : start + val * incr;
 
  309     next(NULL) { 
replace(start, val, incr); };
 
  311   ulonglong minimum()
 const { 
return interval_min;    };
 
  312   ulonglong values()
  const { 
return interval_values; };
 
  313   ulonglong maximum()
 const { 
return interval_max;    };
 
  319   bool merge_if_contiguous(ulonglong start, ulonglong val, ulonglong incr)
 
  321     if (interval_max == start)
 
  323       if (val == ULONGLONG_MAX)
 
  325         interval_values=   interval_max= val;
 
  329         interval_values+=  val;
 
  330         interval_max=      start + val * incr;
 
  351 #define DISCRETE_INTERVAL_LIST_HAS_MAX_ONE_ELEMENT 1 
  372     if (unlikely(new_interval == NULL))
 
  374     DBUG_PRINT(
"info",(
"adding new auto_increment interval"));
 
  376       head= current= new_interval;
 
  378       tail->next= new_interval;
 
  386     first_interval= other->first_interval;
 
  387     head= other->head == o_first_interval ? &first_interval : other->head;
 
  388     tail= other->tail == o_first_interval ? &first_interval : other->tail;
 
  390       other->current == o_first_interval ? &first_interval : other->current;
 
  391     elements= other->elements;
 
  394   { copy_shallow(&other); }
 
  398     : head(NULL), tail(NULL), current(NULL), elements(0) {}
 
  406 #ifdef DISCRETE_INTERVAL_LIST_HAS_MAX_ONE_ELEMENT 
  414     head= tail= current= NULL;
 
  420     other->copy_shallow(
this);
 
  427       current= current->next;
 
  440   bool append(ulonglong start, ulonglong val, ulonglong incr)
 
  445       first_interval.replace(start, val, incr);
 
  446       return append(&first_interval);
 
  449     if (tail->merge_if_contiguous(start, val, incr) == 0)
 
  452 #ifdef DISCRETE_INTERVAL_LIST_HAS_MAX_ONE_ELEMENT 
  468   ulonglong minimum()
     const { 
return (head ? head->minimum() : 0); };
 
  469   ulonglong maximum()
     const { 
return (head ? tail->maximum() : 0); };
 
  470   uint      nb_elements()
 const { 
return elements; }