~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
 
205
205
 
206
206
/* Check if a given table is opened log table */
207
 
int check_if_log_table(uint db_len __attribute__((unused)),
 
207
int check_if_log_table(uint32_t db_len __attribute__((unused)),
208
208
                       const char *db __attribute__((unused)),
209
 
                       uint table_name_len __attribute__((unused)),
 
209
                       uint32_t table_name_len __attribute__((unused)),
210
210
                       const char *table_name __attribute__((unused)),
211
 
                       uint check_if_opened __attribute__((unused)))
 
211
                       uint32_t check_if_opened __attribute__((unused)))
212
212
{
213
213
  return 0;
214
214
}
287
287
  return rc;
288
288
}
289
289
 
290
 
void LOGGER::init_error_log(uint error_log_printer)
 
290
void LOGGER::init_error_log(uint32_t error_log_printer)
291
291
{
292
292
  if (error_log_printer & LOG_NONE)
293
293
  {
297
297
 
298
298
}
299
299
 
300
 
int LOGGER::set_handlers(uint error_log_printer)
 
300
int LOGGER::set_handlers(uint32_t error_log_printer)
301
301
{
302
302
  /* error log table is not supported yet */
303
303
  lock_exclusive();
788
788
static int find_uniq_filename(char *name)
789
789
{
790
790
  long                  number;
791
 
  uint                  i;
 
791
  uint32_t                  i;
792
792
  char                  buff[FN_REFLEN];
793
793
  struct st_my_dir     *dir_info;
794
794
  register struct fileinfo *file_info;
963
963
    The internal structures are not freed until cleanup() is called
964
964
*/
965
965
 
966
 
void DRIZZLE_LOG::close(uint exiting)
 
966
void DRIZZLE_LOG::close(uint32_t exiting)
967
967
{                                       // One can't set log_type here!
968
968
  if (log_state == LOG_OPENED)
969
969
  {
1042
1042
  if (strip_ext)
1043
1043
  {
1044
1044
    char *p= fn_ext(log_name);
1045
 
    uint length= (uint) (p - log_name);
 
1045
    uint32_t length= (uint) (p - log_name);
1046
1046
    strmake(buff, log_name, cmin(length, (uint)FN_REFLEN));
1047
1047
    return (const char*)buff;
1048
1048
  }
1385
1385
{
1386
1386
  int error= 0;
1387
1387
  char *fname= linfo->log_file_name;
1388
 
  uint log_name_len= log_name ? (uint) strlen(log_name) : 0;
 
1388
  uint32_t log_name_len= log_name ? (uint) strlen(log_name) : 0;
1389
1389
 
1390
1390
  /*
1391
1391
    Mutex needed because we need to make sure the file pointer does not
1400
1400
 
1401
1401
  for (;;)
1402
1402
  {
1403
 
    uint length;
 
1403
    uint32_t length;
1404
1404
    my_off_t offset= my_b_tell(&index_file);
1405
1405
    /* If we get 0 or 1 characters, this is the end of the file */
1406
1406
 
1456
1456
int DRIZZLE_BIN_LOG::find_next_log(LOG_INFO* linfo, bool need_lock)
1457
1457
{
1458
1458
  int error= 0;
1459
 
  uint length;
 
1459
  uint32_t length;
1460
1460
  char *fname= linfo->log_file_name;
1461
1461
 
1462
1462
  if (need_lock)
1992
1992
 
1993
1993
void DRIZZLE_BIN_LOG::make_log_name(char* buf, const char* log_ident)
1994
1994
{
1995
 
  uint dir_len = dirname_length(log_file_name); 
 
1995
  uint32_t dir_len = dirname_length(log_file_name); 
1996
1996
  if (dir_len >= FN_REFLEN)
1997
1997
    dir_len=FN_REFLEN-1;
1998
1998
  my_stpncpy(buf, log_file_name, dir_len);
2162
2162
}
2163
2163
 
2164
2164
 
2165
 
bool DRIZZLE_BIN_LOG::appendv(const char* buf, uint len,...)
 
2165
bool DRIZZLE_BIN_LOG::appendv(const char* buf, uint32_t len,...)
2166
2166
{
2167
2167
  bool error= 0;
2168
2168
  va_list(args);
2600
2600
        }
2601
2601
        if (thd->user_var_events.elements)
2602
2602
        {
2603
 
          for (uint i= 0; i < thd->user_var_events.elements; i++)
 
2603
          for (uint32_t i= 0; i < thd->user_var_events.elements; i++)
2604
2604
          {
2605
2605
            BINLOG_USER_VAR_EVENT *user_var_event;
2606
2606
            get_dynamic(&thd->user_var_events,(unsigned char*) &user_var_event, i);
2658
2658
  return logger.error_log_print(level, format, args);
2659
2659
}
2660
2660
 
2661
 
void DRIZZLE_BIN_LOG::rotate_and_purge(uint flags)
 
2661
void DRIZZLE_BIN_LOG::rotate_and_purge(uint32_t flags)
2662
2662
{
2663
2663
  if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED))
2664
2664
    pthread_mutex_lock(&LOCK_log);
2677
2677
    pthread_mutex_unlock(&LOCK_log);
2678
2678
}
2679
2679
 
2680
 
uint DRIZZLE_BIN_LOG::next_file_id()
 
2680
uint32_t DRIZZLE_BIN_LOG::next_file_id()
2681
2681
{
2682
 
  uint res;
 
2682
  uint32_t res;
2683
2683
  pthread_mutex_lock(&LOCK_log);
2684
2684
  res = file_id++;
2685
2685
  pthread_mutex_unlock(&LOCK_log);
2707
2707
 
2708
2708
  if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
2709
2709
    return ER_ERROR_ON_WRITE;
2710
 
  uint length= my_b_bytes_in_cache(cache), group, carry, hdr_offs;
 
2710
  uint32_t length= my_b_bytes_in_cache(cache), group, carry, hdr_offs;
2711
2711
  long val;
2712
2712
  unsigned char header[LOG_EVENT_HEADER_LEN];
2713
2713
 
3011
3011
    The internal structures are not freed until cleanup() is called
3012
3012
*/
3013
3013
 
3014
 
void DRIZZLE_BIN_LOG::close(uint exiting)
 
3014
void DRIZZLE_BIN_LOG::close(uint32_t exiting)
3015
3015
{                                       // One can't set log_type here!
3016
3016
  if (log_state == LOG_OPENED)
3017
3017
  {
3332
3332
 
3333
3333
int TC_LOG_MMAP::open(const char *opt_name)
3334
3334
{
3335
 
  uint i;
 
3335
  uint32_t i;
3336
3336
  bool crashed= false;
3337
3337
  PAGE *pg;
3338
3338
 
3664
3664
 
3665
3665
void TC_LOG_MMAP::close()
3666
3666
{
3667
 
  uint i;
 
3667
  uint32_t i;
3668
3668
  switch (inited) {
3669
3669
  case 6:
3670
3670
    pthread_mutex_destroy(&LOCK_sync);