~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
{
132
132
  /*
133
133
    How dynamically allocated system variables are handled:
134
 
    
 
134
 
135
135
    The global_system_variables and max_system_variables are "authoritative"
136
136
    They both should have the same 'version' and 'size'.
137
137
    When attempting to access a dynamic variable, if the session version
138
138
    is out of date, then the session version is updated and realloced if
139
139
    neccessary and bytes copied from global to make up for missing data.
140
 
  */ 
 
140
  */
141
141
  ulong dynamic_variables_version;
142
142
  char* dynamic_variables_ptr;
143
143
  uint32_t dynamic_variables_head;  /* largest valid variable offset */
144
144
  uint32_t dynamic_variables_size;  /* how many bytes are in use */
145
 
  
 
145
 
146
146
  uint64_t myisam_max_extra_sort_file_size;
147
147
  uint64_t myisam_max_sort_file_size;
148
148
  uint64_t max_heap_table_size;
176
176
      1 - force MRR when the storage engine is capable of doing it
177
177
      2 - disable MRR.
178
178
  */
179
 
  uint32_t optimizer_use_mrr; 
 
179
  uint32_t optimizer_use_mrr;
180
180
  /* A bitmap for switching optimizations on/off */
181
181
  uint32_t optimizer_switch;
182
182
  uint64_t preload_buff_size;
207
207
 
208
208
  bool low_priority_updates;
209
209
  bool new_mode;
210
 
  /* 
 
210
  /*
211
211
    compatibility option:
212
 
      - index usage hints (USE INDEX without a FOR clause) behave as in 5.0 
 
212
      - index usage hints (USE INDEX without a FOR clause) behave as in 5.0
213
213
  */
214
214
  bool old_mode;
215
215
  bool engine_condition_pushdown;
434
434
      it. We will see the query_length field as either 0, or the right value
435
435
      for it.
436
436
    Assuming that the write and read of an n-bit memory field in an n-bit
437
 
    computer is atomic, we can avoid races in the above way. 
 
437
    computer is atomic, we can avoid races in the above way.
438
438
    This printing is needed at least in SHOW PROCESSLIST and SHOW INNODB
439
439
    STATUS.
440
440
  */
507
507
    priv_user - The user privilege we are using. May be "" for anonymous user.
508
508
    ip - client IP
509
509
  */
510
 
  char *user; 
 
510
  char *user;
511
511
  char *ip;
512
512
 
513
513
  void init();
909
909
  /*
910
910
    One thread can hold up to one named user-level lock. This variable
911
911
    points to a lock object if the lock is present. See item_func.cc and
912
 
    chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK. 
 
912
    chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK.
913
913
  */
914
914
  uint32_t dbug_sentry; // watch out for memory corruption
915
915
  struct st_my_thread_var *mysys_var;
925
925
  time_t     start_time, user_time;
926
926
  uint64_t  connect_utime, thr_create_utime; // track down slow pthread_create
927
927
  uint64_t  start_utime, utime_after_lock;
928
 
  
 
928
 
929
929
  thr_lock_type update_lock_default;
930
930
 
931
931
  /* container for handler's private per-connection data */
1241
1241
    Reset to false when we leave the sub-statement mode.
1242
1242
  */
1243
1243
  bool       is_fatal_sub_stmt_error;
1244
 
  bool       query_start_used; 
 
1244
  bool       query_start_used;
1245
1245
  /* for IS NULL => = last_insert_id() fix in remove_eq_conds() */
1246
1246
  bool       substitute_null_with_insert_id;
1247
1247
  bool       in_lock_tables;
1253
1253
  */
1254
1254
  bool       is_slave_error;
1255
1255
  bool       cleanup_done;
1256
 
  
 
1256
 
1257
1257
  /**  is set if some thread specific value(s) used in a statement. */
1258
1258
  bool       thread_specific_used;
1259
1259
  bool       charset_is_system_charset, charset_is_collation_connection;
1280
1280
    ulong     ulong_value;
1281
1281
    uint64_t uint64_t_value;
1282
1282
  } sys_var_tmp;
1283
 
  
 
1283
 
1284
1284
  struct {
1285
 
    /* 
1286
 
      If true, drizzle_bin_log::write(Log_event) call will not write events to 
 
1285
    /*
 
1286
      If true, drizzle_bin_log::write(Log_event) call will not write events to
1287
1287
      binlog, and maintain 2 below variables instead (use
1288
1288
      drizzle_bin_log.start_union_events to turn this on)
1289
1289
    */
1294
1294
    */
1295
1295
    bool unioned_events;
1296
1296
    /*
1297
 
      If true, at least one drizzle_bin_log::write(Log_event e), where 
1298
 
      e.cache_stmt == true call has been made after last 
 
1297
      If true, at least one drizzle_bin_log::write(Log_event e), where
 
1298
      e.cache_stmt == true call has been made after last
1299
1299
      drizzle_bin_log.start_union_events() call.
1300
1300
    */
1301
1301
    bool unioned_events_trans;
1302
 
    
1303
 
    /* 
 
1302
 
 
1303
    /*
1304
1304
      'queries' (actually SP statements) that run under inside this binlog
1305
1305
      union have session->query_id >= first_query_id.
1306
1306
    */
1327
1327
    killing mysqld) where it's vital to not allocate excessive and not used
1328
1328
    memory. Note, that we still don't return error from init_for_queries():
1329
1329
    if preallocation fails, we should notice that at the first call to
1330
 
    alloc_root. 
 
1330
    alloc_root.
1331
1331
  */
1332
1332
  void init_for_queries();
1333
1333
  void change_user(void);
1341
1341
      The query can be logged row-based or statement-based
1342
1342
    */
1343
1343
    ROW_QUERY_TYPE,
1344
 
    
 
1344
 
1345
1345
    /*
1346
1346
      The query has to be logged statement-based
1347
1347
    */
1348
1348
    STMT_QUERY_TYPE,
1349
 
    
 
1349
 
1350
1350
    /*
1351
1351
      The query represents a change to a table in the "mysql"
1352
1352
      database and is currently mapped to ROW_QUERY_TYPE.
1354
1354
    DRIZZLE_QUERY_TYPE,
1355
1355
    QUERY_TYPE_COUNT
1356
1356
  };
1357
 
  
 
1357
 
1358
1358
  int binlog_query(enum_binlog_query_type qtype,
1359
1359
                   char const *query, ulong query_len,
1360
1360
                   bool is_trans, bool suppress_use,
1653
1653
class sql_exchange :public Sql_alloc
1654
1654
{
1655
1655
public:
1656
 
  enum enum_filetype filetype; /* load XML, Added by Arnold & Erik */ 
 
1656
  enum enum_filetype filetype; /* load XML, Added by Arnold & Erik */
1657
1657
  char *file_name;
1658
1658
  String *field_term,*enclosed,*line_term,*line_start,*escaped;
1659
1659
  bool opt_enclosed;
1887
1887
 
1888
1888
#include <storage/myisam/myisam.h>
1889
1889
 
1890
 
/* 
1891
 
  Param to create temporary tables when doing SELECT:s 
 
1890
/*
 
1891
  Param to create temporary tables when doing SELECT:s
1892
1892
  NOTE
1893
1893
    This structure is copied using memcpy as a part of JOIN.
1894
1894
*/
1916
1916
  uint  quick_group;
1917
1917
  bool  using_indirect_summary_function;
1918
1918
  /* If >0 convert all blob fields to varchar(convert_blob_length) */
1919
 
  uint32_t  convert_blob_length; 
1920
 
  const CHARSET_INFO *table_charset; 
 
1919
  uint32_t  convert_blob_length;
 
1920
  const CHARSET_INFO *table_charset;
1921
1921
  bool schema_table;
1922
1922
  /*
1923
1923
    True if GROUP BY and its aggregate functions are already computed
2051
2051
    else
2052
2052
      db= db_arg;
2053
2053
  }
2054
 
  inline Table_ident(LEX_STRING table_arg) 
 
2054
  inline Table_ident(LEX_STRING table_arg)
2055
2055
    :table(table_arg), sel((SELECT_LEX_UNIT *)0)
2056
2056
  {
2057
2057
    db.str=0;
2097
2097
};
2098
2098
 
2099
2099
/*
2100
 
   Unique -- class for unique (removing of duplicates). 
 
2100
   Unique -- class for unique (removing of duplicates).
2101
2101
   Puts all values to the TREE. If the tree becomes too big,
2102
2102
   it's dumped to the file. User can request sorted values, or
2103
2103
   just iterate through them. In the last case tree merging is performed in
2129
2129
  }
2130
2130
 
2131
2131
  bool get(Table *table);
2132
 
  static double get_use_cost(uint32_t *buffer, uint32_t nkeys, uint32_t key_size, 
 
2132
  static double get_use_cost(uint32_t *buffer, uint32_t nkeys, uint32_t key_size,
2133
2133
                             size_t max_in_memory_size);
2134
 
  inline static int get_cost_calc_buff_size(ulong nkeys, uint32_t key_size, 
 
2134
  inline static int get_cost_calc_buff_size(ulong nkeys, uint32_t key_size,
2135
2135
                                            size_t max_in_memory_size)
2136
2136
  {
2137
2137
    register size_t max_elems_in_tree=
2192
2192
  uint32_t table_count;
2193
2193
  /*
2194
2194
   List of tables referenced in the CHECK OPTION condition of
2195
 
   the updated view excluding the updated table. 
 
2195
   the updated view excluding the updated table.
2196
2196
  */
2197
2197
  List <Table> unupdated_check_opt_tables;
2198
2198
  Copy_field *copy_field;
2201
2201
  /* True if the update operation has made a change in a transactional table */
2202
2202
  bool transactional_tables;
2203
2203
  bool ignore;
2204
 
  /* 
 
2204
  /*
2205
2205
     error handling (rollback and binlogging) can happen in send_eof()
2206
2206
     so that afterward send_error() needs to find out that.
2207
2207
  */