~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_log.c

MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                 const uchar *buffert, uint length)
64
64
{
65
65
  uchar buff[11];
66
 
  int error,old_errno;
 
66
  int old_errno;
67
67
  ulong pid=(ulong) GETPID();
68
68
  old_errno=my_errno;
69
69
  bzero(buff,sizeof(buff));
73
73
  mi_int2store(buff+9,length);
74
74
 
75
75
  pthread_mutex_lock(&THR_LOCK_myisam);
76
 
  error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
77
76
  VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0)));
78
77
  VOID(my_write(myisam_log_file,buffert,length,MYF(0)));
79
 
  if (!error)
80
 
    error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
81
78
  pthread_mutex_unlock(&THR_LOCK_myisam);
82
79
  my_errno=old_errno;
83
80
}
87
84
                         const uchar *buffert, uint length, int result)
88
85
{
89
86
  uchar buff[9];
90
 
  int error,old_errno;
 
87
  int old_errno;
91
88
  ulong pid=(ulong) GETPID();
92
89
 
93
90
  old_errno=my_errno;
96
93
  mi_int4store(buff+3,pid);
97
94
  mi_int2store(buff+7,result);
98
95
  pthread_mutex_lock(&THR_LOCK_myisam);
99
 
  error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
100
96
  VOID(my_write(myisam_log_file,buff,sizeof(buff),MYF(0)));
101
97
  if (buffert)
102
98
    VOID(my_write(myisam_log_file,buffert,length,MYF(0)));
103
 
  if (!error)
104
 
    error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
105
99
  pthread_mutex_unlock(&THR_LOCK_myisam);
106
100
  my_errno=old_errno;
107
101
}
111
105
                        const uchar *record, my_off_t filepos, int result)
112
106
{
113
107
  uchar buff[21],*pos;
114
 
  int error,old_errno;
 
108
  int old_errno;
115
109
  uint length;
116
110
  ulong pid=(ulong) GETPID();
117
111
 
127
121
  mi_sizestore(buff+9,filepos);
128
122
  mi_int4store(buff+17,length);
129
123
  pthread_mutex_lock(&THR_LOCK_myisam);
130
 
  error=my_lock(myisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
131
124
  VOID(my_write(myisam_log_file, buff,sizeof(buff),MYF(0)));
132
125
  VOID(my_write(myisam_log_file, record,info->s->base.reclength,MYF(0)));
133
126
  if (info->s->base.blobs)
143
136
      VOID(my_write(myisam_log_file,pos,blob->length,MYF(0)));
144
137
    }
145
138
  }
146
 
  if (!error)
147
 
    error=my_lock(myisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
148
139
  pthread_mutex_unlock(&THR_LOCK_myisam);
149
140
  my_errno=old_errno;
150
141
}