~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/sql_class.h

  • Committer: Brian Aker
  • Date: 2008-07-13 22:21:51 UTC
  • Revision ID: brian@tangent.org-20080713222151-fv2tcpbsc829j2oc
Ulonglong to uint64_t

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
  uint dynamic_variables_head;  /* largest valid variable offset */
260
260
  uint dynamic_variables_size;  /* how many bytes are in use */
261
261
  
262
 
  ulonglong myisam_max_extra_sort_file_size;
263
 
  ulonglong myisam_max_sort_file_size;
264
 
  ulonglong max_heap_table_size;
265
 
  ulonglong tmp_table_size;
266
 
  ulonglong long_query_time;
 
262
  uint64_t myisam_max_extra_sort_file_size;
 
263
  uint64_t myisam_max_sort_file_size;
 
264
  uint64_t max_heap_table_size;
 
265
  uint64_t tmp_table_size;
 
266
  uint64_t long_query_time;
267
267
  ha_rows select_limit;
268
268
  ha_rows max_join_size;
269
269
  ulong auto_increment_increment, auto_increment_offset;
365
365
 
366
366
typedef struct system_status_var
367
367
{
368
 
  ulonglong bytes_received;
369
 
  ulonglong bytes_sent;
 
368
  uint64_t bytes_received;
 
369
  uint64_t bytes_sent;
370
370
  ulong com_other;
371
371
  ulong com_stat[(uint) SQLCOM_END];
372
372
  ulong created_tmp_disk_tables;
792
792
class Sub_statement_state
793
793
{
794
794
public:
795
 
  ulonglong options;
796
 
  ulonglong first_successful_insert_id_in_prev_stmt;
797
 
  ulonglong first_successful_insert_id_in_cur_stmt, insert_id_for_cur_row;
 
795
  uint64_t options;
 
796
  uint64_t first_successful_insert_id_in_prev_stmt;
 
797
  uint64_t first_successful_insert_id_in_cur_stmt, insert_id_for_cur_row;
798
798
  Discrete_interval auto_inc_interval_for_cur_row;
799
799
  Discrete_intervals_list auto_inc_intervals_forced;
800
 
  ulonglong limit_found_rows;
 
800
  uint64_t limit_found_rows;
801
801
  ha_rows    cuted_fields, sent_row_count, examined_row_count;
802
802
  ulong client_capabilities;
803
803
  uint in_sub_stmt;
889
889
  bool can_overwrite_status;
890
890
 
891
891
  void set_ok_status(THD *thd, ha_rows affected_rows_arg,
892
 
                     ulonglong last_insert_id_arg,
 
892
                     uint64_t last_insert_id_arg,
893
893
                     const char *message);
894
894
  void set_eof_status(THD *thd);
895
895
  void set_error_status(THD *thd, uint sql_errno_arg, const char *message_arg);
920
920
  ha_rows affected_rows() const
921
921
  { assert(m_status == DA_OK); return m_affected_rows; }
922
922
 
923
 
  ulonglong last_insert_id() const
 
923
  uint64_t last_insert_id() const
924
924
  { assert(m_status == DA_OK); return m_last_insert_id; }
925
925
 
926
926
  uint total_warn_count() const
966
966
    thd->first_successful_insert_id_in_prev_stmt, which is used
967
967
    to implement LAST_INSERT_ID().
968
968
  */
969
 
  ulonglong   m_last_insert_id;
 
969
  uint64_t   m_last_insert_id;
970
970
  /** The total number of warnings. */
971
971
  uint       m_total_warn_count;
972
972
  enum_diagnostics_status m_status;
1113
1113
  /* remote (peer) port */
1114
1114
  uint16 peer_port;
1115
1115
  time_t     start_time, user_time;
1116
 
  ulonglong  connect_utime, thr_create_utime; // track down slow pthread_create
1117
 
  ulonglong  start_utime, utime_after_lock;
 
1116
  uint64_t  connect_utime, thr_create_utime; // track down slow pthread_create
 
1117
  uint64_t  start_utime, utime_after_lock;
1118
1118
  
1119
1119
  thr_lock_type update_lock_default;
1120
1120
 
1249
1249
    It can also be set by SET LAST_INSERT_ID=# or SELECT LAST_INSERT_ID(#).
1250
1250
    It is returned by LAST_INSERT_ID().
1251
1251
  */
1252
 
  ulonglong  first_successful_insert_id_in_prev_stmt;
 
1252
  uint64_t  first_successful_insert_id_in_prev_stmt;
1253
1253
  /*
1254
1254
    Variant of the above, used for storing in statement-based binlog. The
1255
1255
    difference is that the one above can change as the execution of a stored
1256
1256
    function progresses, while the one below is set once and then does not
1257
1257
    change (which is the value which statement-based binlog needs).
1258
1258
  */
1259
 
  ulonglong  first_successful_insert_id_in_prev_stmt_for_binlog;
 
1259
  uint64_t  first_successful_insert_id_in_prev_stmt_for_binlog;
1260
1260
  /*
1261
1261
    This is the first autogenerated insert id which was *successfully*
1262
1262
    inserted by the current statement. It is maintained only to set
1263
1263
    first_successful_insert_id_in_prev_stmt when statement ends.
1264
1264
  */
1265
 
  ulonglong  first_successful_insert_id_in_cur_stmt;
 
1265
  uint64_t  first_successful_insert_id_in_cur_stmt;
1266
1266
  /*
1267
1267
    We follow this logic:
1268
1268
    - when stmt starts, first_successful_insert_id_in_prev_stmt contains the
1342
1342
    mode, row-based binlogging is used for such cases where two
1343
1343
    auto_increment columns are inserted.
1344
1344
  */
1345
 
  inline void record_first_successful_insert_id_in_cur_stmt(ulonglong id_arg)
 
1345
  inline void record_first_successful_insert_id_in_cur_stmt(uint64_t id_arg)
1346
1346
  {
1347
1347
    if (first_successful_insert_id_in_cur_stmt == 0)
1348
1348
      first_successful_insert_id_in_cur_stmt= id_arg;
1349
1349
  }
1350
 
  inline ulonglong read_first_successful_insert_id_in_prev_stmt(void)
 
1350
  inline uint64_t read_first_successful_insert_id_in_prev_stmt(void)
1351
1351
  {
1352
1352
    if (!stmt_depends_on_first_successful_insert_id_in_prev_stmt)
1353
1353
    {
1363
1363
    (mysqlbinlog). We'll soon add a variant which can take many intervals in
1364
1364
    argument.
1365
1365
  */
1366
 
  inline void force_one_auto_inc_interval(ulonglong next_id)
 
1366
  inline void force_one_auto_inc_interval(uint64_t next_id)
1367
1367
  {
1368
1368
    auto_inc_intervals_forced.empty(); // in case of multiple SET INSERT_ID
1369
1369
    auto_inc_intervals_forced.append(next_id, ULONGLONG_MAX, 0);
1370
1370
  }
1371
1371
 
1372
 
  ulonglong  limit_found_rows;
1373
 
  ulonglong  options;           /* Bitmap of states */
 
1372
  uint64_t  limit_found_rows;
 
1373
  uint64_t  options;           /* Bitmap of states */
1374
1374
  longlong   row_count_func;    /* For the ROW_COUNT() function */
1375
1375
  ha_rows    cuted_fields;
1376
1376
 
1523
1523
    my_bool   my_bool_value;
1524
1524
    long      long_value;
1525
1525
    ulong     ulong_value;
1526
 
    ulonglong ulonglong_value;
 
1526
    uint64_t uint64_t_value;
1527
1527
  } sys_var_tmp;
1528
1528
  
1529
1529
  struct {
1678
1678
    start_utime= utime_after_lock= my_micro_time();
1679
1679
  }
1680
1680
  void set_time_after_lock()  { utime_after_lock= my_micro_time(); }
1681
 
  ulonglong current_utime()  { return my_micro_time(); }
1682
 
  inline ulonglong found_rows(void)
 
1681
  uint64_t current_utime()  { return my_micro_time(); }
 
1682
  inline uint64_t found_rows(void)
1683
1683
  {
1684
1684
    return limit_found_rows;
1685
1685
  }
1962
1962
/** A short cut for thd->main_da.set_ok_status(). */
1963
1963
 
1964
1964
inline void
1965
 
my_ok(THD *thd, ha_rows affected_rows= 0, ulonglong id= 0,
 
1965
my_ok(THD *thd, ha_rows affected_rows= 0, uint64_t id= 0,
1966
1966
        const char *message= NULL)
1967
1967
{
1968
1968
  thd->main_da.set_ok_status(thd, affected_rows, id, message);
1978
1978
}
1979
1979
 
1980
1980
#define tmp_disable_binlog(A)       \
1981
 
  {ulonglong tmp_disable_binlog__save_options= (A)->options; \
 
1981
  {uint64_t tmp_disable_binlog__save_options= (A)->options; \
1982
1982
  (A)->options&= ~OPTION_BIN_LOG
1983
1983
 
1984
1984
#define reenable_binlog(A)   (A)->options= tmp_disable_binlog__save_options;}
2164
2164
  TABLE_LIST *table_list;
2165
2165
  TABLE *table;
2166
2166
  List<Item> *fields;
2167
 
  ulonglong autoinc_value_of_last_inserted_row; // autogenerated or not
 
2167
  uint64_t autoinc_value_of_last_inserted_row; // autogenerated or not
2168
2168
  COPY_INFO info;
2169
2169
  bool insert_into_view;
2170
2170
  select_insert(TABLE_LIST *table_list_par,
2307
2307
  bool flush();
2308
2308
  void cleanup();
2309
2309
  bool create_result_table(THD *thd, List<Item> *column_types,
2310
 
                           bool is_distinct, ulonglong options,
 
2310
                           bool is_distinct, uint64_t options,
2311
2311
                           const char *alias, bool bit_fields_as_long);
2312
2312
};
2313
2313
 
2454
2454
{
2455
2455
  DYNAMIC_ARRAY file_ptrs;
2456
2456
  ulong max_elements;
2457
 
  ulonglong max_in_memory_size;
 
2457
  uint64_t max_in_memory_size;
2458
2458
  IO_CACHE file;
2459
2459
  TREE tree;
2460
2460
  uchar *record_pointers;
2464
2464
public:
2465
2465
  ulong elements;
2466
2466
  Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg,
2467
 
         uint size_arg, ulonglong max_in_memory_size_arg);
 
2467
         uint size_arg, uint64_t max_in_memory_size_arg);
2468
2468
  ~Unique();
2469
2469
  ulong elements_in_tree() { return tree.elements_in_tree; }
2470
2470
  inline bool unique_add(void *ptr)
2476
2476
 
2477
2477
  bool get(TABLE *table);
2478
2478
  static double get_use_cost(uint *buffer, uint nkeys, uint key_size, 
2479
 
                             ulonglong max_in_memory_size);
 
2479
                             uint64_t max_in_memory_size);
2480
2480
  inline static int get_cost_calc_buff_size(ulong nkeys, uint key_size, 
2481
 
                                            ulonglong max_in_memory_size)
 
2481
                                            uint64_t max_in_memory_size)
2482
2482
  {
2483
 
    register ulonglong max_elems_in_tree=
 
2483
    register uint64_t max_elems_in_tree=
2484
2484
      (1 + max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size));
2485
2485
    return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree));
2486
2486
  }